import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_keep_book/app/index/item_type/item_type_view_model.dart';
import 'package:flutter_keep_book/app/widgets/keep_book_list_view.dart';
import '../../constant/colors.dart';
import '../../model/vo/item_type_vo.dart';
import '../../widgets/rounded_container.dart';

class ItemTypeListView extends KeepBookListView<ItemTypeVo> {
  const ItemTypeListView({
    super.key,
    required ItemTypeViewModel viewModel,
  }) : super(viewModel: viewModel);



  @override
  KeepBookListViewState<ItemTypeVo> createState() =>_ItemTypeListPageState();
}

class _ItemTypeListPageState extends KeepBookListViewState<ItemTypeVo> {

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return RoundedContainer(
      height: double.infinity,
      radius: 0,
      margin: const EdgeInsets.only(left: 0, right: 0, top: 10),
      padding: const EdgeInsets.only(top: 5),
      color: MagicColors.CouponListBg,
      child: stateBody,
    );
  }

  @override
  Widget itemBuilder(BuildContext context, int index, ItemTypeVo value) {
    return   ListTile(
        title: Text(value.itemName ?? ""),
          subtitle: Text(value.itemLevel == 1 ? "一级分类" : "二级分类"));
  }
}
